<?php

namespace app\validate;

use think\Validate;

class UserValidate extends Validate
{
    protected $rule = [
        'password|密码'       =>  'max:32|min:32',
        'username|用户名'     => 'require|max:10',
        'role|权限'     => 'require',
    ];

    protected $scene = [
        'add' => ['username', 'phone', 'role'],
        'login' => ['username', 'password'],
    ];

}